<template>
  <div class>
    <div
      v-if="showInfo"
      class="cesiumdialog"
      :style="{
        left: winPos[0] - getscalepxcnum(0) + 'px',
        bottom: winPos[3] + 'px',
      }"
    >
      <div class="contain">
        <!-- 关闭图标 -->
        <i
          class="el-icon-close"
          :style="{
            position: 'absolute',
            right: getscalepxc(10),
            top: getscalepxc(6),
            fontSize: getscalepxc(12),
            pointerEvents: 'auto',
            cursor: 'pointer',
          }"
          @click="closecard()"
        ></i>
        <div style="position: absolute; top: 5px; left: 111px;font-size: 10px;">
          <span style="font-size: 12px; color: #ffe799">巡检人员：{{name}}</span>
        </div>
        <div class="textContain">
          <div style="display: flex;flex-direction: column; justify-content: space-around;height: 80%;padding-top: 10px;font-size: 10px;">
            <div style="display: flex;">
              <div style="color: #a0c8db; padding-left: 13px">起点：</div>
              <div style="color: #ff6300">{{startpos}}</div>
            </div>
            <div style="display: flex;">
              <div style="color: #a0c8db; padding-left: 13px">巡检时长：</div>
              <div style="color: #ff6300">{{time}}</div>
            </div>
          </div>
        </div>
      </div>
      <!-- <div class="smallcircle"></div>
      <div class="bigcircle"></div> -->
    </div>
  </div>
</template>
<script>
import uuidv1 from "uuid/v1";
import * as echarts from "echarts/dist/echarts";
import commonmixins from "@/mixins/bigScreen/commonmixins";

import basecard from "../base.vue";

import dayjs from 'dayjs'

export default {
  name: "xunjiancard",
  extends: basecard,
  mixins: [commonmixins],
  components: {},
  data() {
    return {
      time: '',
      startpos: '',
      name: '',
    };
  },
  computed: {},
  watch: {},
  mounted() {
    this.instance.show = false
    // this.instance.scale = 0.3
    // this.instance.imageUrl = '/configuration/ziyuan/xunjianxiaoren.png'
    this.name = this.options.item.inspectUserName
    this.startpos = this.options.item.startPosName
    let minute = dayjs(this.options.item.endTime).diff(this.options.item.startTime, 'minute')
    this.time = (minute/60).toFixed(0) + '小时' + minute%60 + '分钟'
  },
  methods: {},
};
</script>
<style lang='scss' scoped>
.cesiumdialog {
  pointer-events: none;
  position: absolute;
  // width: 500px;
  // height: 400px;
  // color: #aed2e2;
  // background-image: url("/configuration/beijing/dialog.png");
  // background-size: 100% 100%;
  // background-color: #fff0;
  // padding: 5px;
  // border-radius: 5px;
  // pointer-events: none;
  // cursor: pointer;
  // font-size: 18px;
  // font-size: 18px;
}
.contain {
  position: absolute;
  height: 90px;
  width: 400px;
  left: -3px;
  top: -87px;
  color: white;
  background-size: 100% 100%;
  padding: 5px;
  border-radius: 5px;
  cursor: pointer;
  background-image: url("/configuration/ziyuan/xunjiandia.png");
}
.textContain {
  position: absolute;
  cursor: pointer;
  line-height: 15px;
  top: 20px;
  bottom: 0px;
  left: 91px;
  color: white;
  padding: 2px;
  width: 305px;
}
.textItem {
  display: block;
  font-size: 14px;
  color: #ffffff;
  line-height: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
}
@keyframes scale {
  0% {
    transform: scale(1);
  }
  50%,
  75% {
    transform: scale(3);
  }
  78%,
  100% {
    opacity: 0;
  }
}
@keyframes scales {
  0% {
    transform: scale(1);
  }
  50%,
  75% {
    transform: scale(2);
  }
  78%,
  100% {
    opacity: 0;
  }
}
.smallcircle {
  position: absolute;
  width: 12px;
  height: 12px;
  background-color: #F8B440;
  opacity: 0.8;
  border-radius: 50%;
  top: -4px;
  left: -6px;
}
.smallcircle:before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  opacity: 0.4;
  background-color: #F8B440;
  opacity: 0.8;
  animation: scale 1s infinite cubic-bezier(0, 0, 0.49, 1.02);
}
.bigcircle {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  opacity: 0.4;
  background-color: #F8B440;
  opacity: 0.8;
  animation: scales 1s infinite cubic-bezier(0, 0, 0.49, 1.02);
  top: -4px;
  left: -6px;
}
</style>